package com.ks.product.controller;

import com.ks.common.model.response.RespBaseDto;
import com.ks.product.model.request.ReqDecreaseStockDto;
import com.ks.product.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product/")
public class ProductController {

    @Autowired
    private IProductService productService;

    @PostMapping("decreasing")
    public RespBaseDto decreaseStock(@RequestBody ReqDecreaseStockDto request) {
        productService.decreaseStock(request);
        return RespBaseDto.getInstance().success();
    }


}
